import 'package:flutter_test/flutter_test.dart';
import 'package:component_record_plus/component_record_plus.dart';
import 'package:component_record_plus/component_record_plus_platform_interface.dart';
import 'package:component_record_plus/component_record_plus_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentRecordPlusPlatform
    with MockPlatformInterfaceMixin
    implements ComponentRecordPlusPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentRecordPlusPlatform initialPlatform = ComponentRecordPlusPlatform.instance;

  test('$MethodChannelComponentRecordPlus is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentRecordPlus>());
  });

  test('getPlatformVersion', () async {
    ComponentRecordPlus componentRecordPlusPlugin = ComponentRecordPlus();
    MockComponentRecordPlusPlatform fakePlatform = MockComponentRecordPlusPlatform();
    ComponentRecordPlusPlatform.instance = fakePlatform;

    expect(await componentRecordPlusPlugin.getPlatformVersion(), '42');
  });
}
